package com.spring.example.mybatis.utils;

import java.lang.reflect.Proxy;

/**
 * @author zhouhengzhe
 * @description:
 * @date 2021/11/30 下午10:13
 * @since v1
 */
public class ZhzSession {

	//返回一个特定的代理对象,该代理对象必须实现clazz接口
	public Object getProxyMapper(Class<?> clazz){
		ClassLoader classLoader = this.getClass().getClassLoader();
		Class<?>[] c =new Class<?>[]{clazz};
		Object proxy = Proxy.newProxyInstance(classLoader, c, new ZhzInvocationHandler(clazz));
		return proxy;
	}
}
